package com.xlh.server.protocol.support.json;

import android.view.View;
import android.widget.Toast;

import com.xlh.Utils.GsonManager;
import com.xlh.bean.ProtocolObject.Base;
import com.xlh.fgs.CreateRoleFg;
import com.xlh.interf.IActivity;
import com.xlh.interf.ITakeMessage;
import com.xlh.outside.R;

/**
 * // 注册
 *
 * Created by Created by mike@Q184377367 on 2018/7/2. on 2018/7/2.
 */

public class RegBoxServer implements ITakeMessage {

    private IActivity atv;
    private String hasType = "regBox";
    private Base protccoObj;
    public RegBoxServer(IActivity atv){
        this.atv = atv;
    }

    @Override
    public void takeMessage(String t,String s){

        if(!t.equals(this.hasType)) return;

        protccoObj =  GsonManager.gsmgr.jsonToAnyObject(s, Base.class);

        if(protccoObj==null ) return;
        this.atv.getActivity().gamescene.setVisibility(View.GONE);
        this.atv.getActivity().fullsceneContainer.setVisibility(View.VISIBLE);
        this.atv.getActivity().getFragmentManager().beginTransaction().replace(R.id.fullscene_container, new CreateRoleFg()).commitAllowingStateLoss();


    }

    @Override
    public boolean takeMessage(String s) {
        return false;
    }

    @Override
    public void init() {

    }

    @Override
    public void atViewLoadAfterInit() {

    }






}
